package com.wind.base.utils;

import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.wind.base.R;

public class ViewInflater {

    public static void inflateText(TextView tv,String txt){
        tv.setText(txt);
    }
    public static void inflateImage(ImageView iv, String url){

        inflateImage(iv,url,R.drawable.placeholder_bg);

    }
    public static void inflateImage(ImageView iv, String url,int placeholder){
        RequestOptions options=new RequestOptions();
        options.placeholder(placeholder);
        Glide
                .with(iv.getContext())
                .load(url)
                .apply(options)
                .into(iv);
    }
}
